gl renderer: Check for pointer equality in rounded_rect_equal
authorTimm Bäder <mail@baedert.org>
Mon, 21 Dec 2020 13:13:48 +0000 (14:13 +0100)
committerTimm Bäder <mail@baedert.org>
Mon, 21 Dec 2020 14:22:08 +0000 (15:22 +0100)
gsk/gl/gskglrenderops.c

index d7639162ad03d61ab22bcd9e4cafe776b64ef90b..8bd420e7bd88d44234bc13c4150d47ec919f0e2d 100644 (file)
@@ -14,27 +14,28 @@ rect_equal (const graphene_rect_t *a,
   return memcmp (a, b, sizeof (graphene_rect_t)) == 0;
 }
 
-static inline gboolean G_GNUC_PURE
+static inline bool G_GNUC_PURE
 rounded_rect_equal (const GskRoundedRect *r1,
                     const GskRoundedRect *r2)
 {
-  int i;
+  if (r1 == r2)
+      return true;
 
   if (!r1)
-    return FALSE;
+    return false;
 
   if (r1->bounds.origin.x != r2->bounds.origin.x ||
       r1->bounds.origin.y != r2->bounds.origin.y ||
       r1->bounds.size.width != r2->bounds.size.width ||
       r1->bounds.size.height != r2->bounds.size.height)
-    return FALSE;
+    return false;
 
-  for (i = 0; i < 4; i ++)
+  for (int i = 0; i < 4; i ++)
     if (r1->corner[i].width != r2->corner[i].width ||
         r1->corner[i].height != r2->corner[i].height)
-      return FALSE;
+      return false;
 
-  return TRUE;
+  return true;
 }
 
 static inline gboolean G_GNUC_PURE